
function showAdvancedSearchMenu() {
    var obj = document.getElementById("advancedSearchMenu");
    obj.style.display="block";
}

function closeAdvancedSearchMenu() {
    var obj = document.getElementById("advancedSearchMenu");
    obj.style.display="none";
}


  MyUtil = new Object();
            MyUtil.selectFilterData = new Object();
    
            MyUtil.selectFilter = function(selectId, filter) {
                var list = document.getElementById(selectId);
                if(!MyUtil.selectFilterData[selectId]) {
                    MyUtil.selectFilterData[selectId] = new Object();
                    
                }
				
                for(var i = 0; i < list.options.length; i++) MyUtil.selectFilterData[selectId][list.options[i].value]  = list.options[i];
				
                list.options.length = 0;  
                for(var key in MyUtil.selectFilterData[selectId]) {
                    var o = MyUtil.selectFilterData[selectId][key];
                    if(o.text.toLowerCase().indexOf(filter.toLowerCase()) >= 0) list.add(o, key);
                }
            }
            function f_optionMove(s_from, s_to) {
                var e_from = document.getElementById(s_from);
                var e_to = document.getElementById(s_to);

                for (var i = 0; i < e_from.options.length; i++) {
                    if (e_from.options[i].selected) {
                        var b = false;
                        for (var k = 0; k < e_to.options.length; k++) 
                            if(e_from.options[i].value.indexOf(e_to.options[k].value) >= 0) b = true;
                        if (!b) 
                            e_to.options[e_to.options.length] = new Option(e_from.options[i].text, e_from.options[i].value);
                    }
                }
    		var s="";
                var hiddeninp = document.getElementsByName(s_to)[0];
                for (var i = 0; i < e_to.options.length; i++) {                
                    s = s + e_to.options[i].value + ";";                                            
                }
                hiddeninp.value = s;
            }
            
            function f_optionDelete(s_from) {
                for (var k = 0; k < s_from.length; k++) {
                    var e_from = document.getElementById(s_from[k]);
		
                    var n_del = 0;
                    for (var i = 0; i < e_from.options.length; i++) {
                        if (e_from.options[i].selected) {
                            n_del++;
                        }
                        else if (n_del)
                            e_from.options[i - n_del] = new Option(e_from.options[i].text, e_from.options[i].value);
                    }
                    if (n_del) {
                        e_from.options.length = e_from.options.length - n_del;
        		var s="";
                        var hiddeninp = document.getElementsByName(s_from[k])[0];
                        for (var i = 0; i < e_from.options.length; i++) {                
                            s = s + e_from.options[i].value + ";";                                            
                        }
                        hiddeninp.value = s;
                    }
                }
            }
